.class final Lcom/google/zxing/client/android/f;
.super Landroid/os/Handler;


# instance fields
.field private final a:Lcom/google/zxing/client/android/CaptureActivity;

.field private final b:Lcom/google/zxing/h;

.field private c:Z


# direct methods
.method constructor <init>(Lcom/google/zxing/client/android/CaptureActivity;Ljava/util/Map;)V
    .locals 1

    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/google/zxing/client/android/f;->c:Z

    new-instance v0, Lcom/google/zxing/h;

    invoke-direct {v0}, Lcom/google/zxing/h;-><init>()V

    iput-object v0, p0, Lcom/google/zxing/client/android/f;->b:Lcom/google/zxing/h;

    iget-object v0, p0, Lcom/google/zxing/client/android/f;->b:Lcom/google/zxing/h;

    invoke-virtual {v0, p2}, Lcom/google/zxing/h;->a(Ljava/util/Map;)V

    iput-object p1, p0, Lcom/google/zxing/client/android/f;->a:Lcom/google/zxing/client/android/CaptureActivity;

    return-void
.end method

.method private static a(Lcom/google/zxing/j;Landroid/os/Bundle;)V
    .locals 6

    invoke-virtual {p0}, Lcom/google/zxing/j;->f()[I

    move-result-object v0

    invoke-virtual {p0}, Lcom/google/zxing/j;->g()I

    move-result v2

    invoke-virtual {p0}, Lcom/google/zxing/j;->h()I

    move-result v4

    const/4 v1, 0x0

    sget-object v5, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    move v3, v2

    invoke-static/range {v0 .. v5}, Landroid/graphics/Bitmap;->createBitmap([IIIIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v0

    new-instance v1, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v1}, Ljava/io/ByteArrayOutputStream;-><init>()V

    sget-object v3, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v4, 0x32

    invoke-virtual {v0, v3, v4, v1}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    const-string v0, "barcode_bitmap"

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v1

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putByteArray(Ljava/lang/String;[B)V

    const-string v0, "barcode_scaled_factor"

    int-to-float v1, v2

    invoke-virtual {p0}, Lcom/google/zxing/j;->b()I

    move-result v2

    int-to-float v2, v2

    div-float/2addr v1, v2

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putFloat(Ljava/lang/String;F)V

    return-void
.end method

.method private a([BII)V
    .locals 8

    const/4 v3, 0x0

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/google/zxing/client/android/f;->a:Lcom/google/zxing/client/android/CaptureActivity;

    iget v0, v0, Lcom/google/zxing/client/android/CaptureActivity;->a:I

    const/4 v2, 0x1

    if-ne v0, v2, :cond_5

    array-length v0, p1

    new-array v0, v0, [B

    move v4, v3

    :goto_0
    if-lt v4, p3, :cond_1

    move-object p1, v0

    :goto_1
    iget-object v0, p0, Lcom/google/zxing/client/android/f;->a:Lcom/google/zxing/client/android/CaptureActivity;

    invoke-virtual {v0}, Lcom/google/zxing/client/android/CaptureActivity;->c()Lcom/google/zxing/client/android/a/e;

    move-result-object v0

    invoke-virtual {v0, p1, p3, p2}, Lcom/google/zxing/client/android/a/e;->a([BII)Lcom/google/zxing/j;

    move-result-object v2

    if-eqz v2, :cond_4

    new-instance v0, Lcom/google/zxing/c;

    new-instance v3, Lcom/google/zxing/b/j;

    invoke-direct {v3, v2}, Lcom/google/zxing/b/j;-><init>(Lcom/google/zxing/g;)V

    invoke-direct {v0, v3}, Lcom/google/zxing/c;-><init>(Lcom/google/zxing/b;)V

    :try_start_0
    iget-object v3, p0, Lcom/google/zxing/client/android/f;->b:Lcom/google/zxing/h;

    invoke-virtual {v3, v0}, Lcom/google/zxing/h;->a(Lcom/google/zxing/c;)Lcom/google/zxing/m;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Lcom/google/zxing/l; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    iget-object v1, p0, Lcom/google/zxing/client/android/f;->b:Lcom/google/zxing/h;

    invoke-virtual {v1}, Lcom/google/zxing/h;->a()V

    :goto_2
    iget-object v1, p0, Lcom/google/zxing/client/android/f;->a:Lcom/google/zxing/client/android/CaptureActivity;

    invoke-virtual {v1}, Lcom/google/zxing/client/android/CaptureActivity;->b()Landroid/os/Handler;

    move-result-object v1

    if-eqz v0, :cond_3

    if-eqz v1, :cond_0

    const v3, 0x7f0a0012

    invoke-static {v1, v3, v0}, Landroid/os/Message;->obtain(Landroid/os/Handler;ILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    new-instance v1, Landroid/os/Bundle;

    invoke-direct {v1}, Landroid/os/Bundle;-><init>()V

    invoke-static {v2, v1}, Lcom/google/zxing/client/android/f;->a(Lcom/google/zxing/j;Landroid/os/Bundle;)V

    invoke-virtual {v0, v1}, Landroid/os/Message;->setData(Landroid/os/Bundle;)V

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V

    :cond_0
    :goto_3
    return-void

    :cond_1
    move v2, v3

    :goto_4
    if-lt v2, p2, :cond_2

    add-int/lit8 v2, v4, 0x1

    move v4, v2

    goto :goto_0

    :cond_2
    mul-int v5, v2, p3

    add-int/2addr v5, p3

    sub-int/2addr v5, v4

    add-int/lit8 v5, v5, -0x1

    mul-int v6, v4, p2

    add-int/2addr v6, v2

    aget-byte v6, p1, v6

    aput-byte v6, v0, v5

    add-int/lit8 v2, v2, 0x1

    goto :goto_4

    :catch_0
    move-exception v0

    iget-object v0, p0, Lcom/google/zxing/client/android/f;->b:Lcom/google/zxing/h;

    invoke-virtual {v0}, Lcom/google/zxing/h;->a()V

    move-object v0, v1

    goto :goto_2

    :catchall_0
    move-exception v0

    iget-object v1, p0, Lcom/google/zxing/client/android/f;->b:Lcom/google/zxing/h;

    invoke-virtual {v1}, Lcom/google/zxing/h;->a()V

    throw v0

    :cond_3
    if-eqz v1, :cond_0

    const v0, 0x7f0a0011

    invoke-static {v1, v0}, Landroid/os/Message;->obtain(Landroid/os/Handler;I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V

    goto :goto_3

    :cond_4
    move-object v0, v1

    goto :goto_2

    :cond_5
    move v7, p3

    move p3, p2

    move p2, v7

    goto :goto_1
.end method


# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 3

    iget-boolean v0, p0, Lcom/google/zxing/client/android/f;->c:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget v0, p1, Landroid/os/Message;->what:I

    sparse-switch v0, :sswitch_data_0

    goto :goto_0

    :sswitch_0
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, [B

    iget v1, p1, Landroid/os/Message;->arg1:I

    iget v2, p1, Landroid/os/Message;->arg2:I

    invoke-direct {p0, v0, v1, v2}, Lcom/google/zxing/client/android/f;->a([BII)V

    goto :goto_0

    :sswitch_1
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/google/zxing/client/android/f;->c:Z

    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Looper;->quit()V

    goto :goto_0

    :sswitch_data_0
    .sparse-switch
        0x7f0a0010 -> :sswitch_0
        0x7f0a0014 -> :sswitch_1
    .end sparse-switch
.end method
